[ Mega Script Archive ] [ Frequently Asked Questions ] [ FormMail ]

  1. Everything works, but I don't receive the data.
  2. Can I have multiple recipients?
  3. The redirect command won't work.

Everything works, but I don't receive the data.

  • Short Answer:

    Check your mail path.

    Long Answer:

    This often happens to users because of one of two problems. Either they haven't corrected the sendmail path or their email address, or they don't have sendmail.

    1. Check path to sendmail and mailing address - Remember if you turn on the mail option you must set two new variables. The $mailprog variable and the $recipient variable. Many people run into the problem on the $mailprog variable, because they forget to change this. Many systems do not have sendmail in the /usr/lib directory which is default in my scripts, and some don't even have sendmail! To find out where its located on your system, use the following command at your unix prompt:

          which sendmail

    This will tell you where sendmail is on your system. If it says it could not find it, you don't necessarily not have it, just ask your system administrator. The other common problem is to make sure that you have set your email address correctly.

    2. The second most common error is that your system doesn't have sendmail. If this is the case, ask your system administrator what mail programs you do have that you can send mail from a cgi program with? Some of them are: mailx, mail, etc... You can use the which command for these as well. If anyone has a patch for mailx or whatever, send it to me and I will put it here.


Can I have multiple recipients?

  • Short Answer:

    Yes.

    Long Answer:

    Yes, all you have to do is put multiple e-mail addresses in the recipient field of your form, separated by commas.

        <input type=hidden name="recipient"
         value="email1@address1.com,email2@address2.net">

The redirect command won't work.

  • Short Answer:

    There's a bug.

    Long Answer:

    When the code was written, I made it check for basic syntax of a URL before sending the user there, so it made sure that the URL started with http://. If your URL does not start with that, you will either have to change the redirect URL so that it does, or modify the script. If you wish to modify the script, open up FormMail and find the line which looks like:

           if ($CONFIG{'redirect'} =~ /http\:\/\/.*\..*/) {

    That is line 204 in the standard distribution. Simply change it to read:

           if ($CONFIG{'redirect'}) {

    and it should then work for any URL or URI you place in the redirect form field.


[ Mega Script Archive ]